<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Article extends Model
{
    use SoftDeletes;

    protected $table = 'article';
    
    protected $fillable = [
        'title',
        'author',
        'content',
        'points_awarded',
        'status',
        'view_count',
        'sort_order',
    ];

    protected $casts = [
        'create_time' => 'datetime',
        'update_time' => 'datetime',
        'delete_time' => 'datetime',
        'is_deleted' => 'boolean',
        'status' => 'integer',
        'points_awarded' => 'integer',
        'view_count' => 'integer',
        'sort_order' => 'integer'
    ];

    // 指定时间戳字段名
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    const DELETED_AT = 'delete_time';
} 